package org.jeecg.common.modules.xetdoctor.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.common.modules.xetdoctor.entity.XetDoctor;
import org.jeecg.common.modules.xetdoctor.mapper.XetDoctorMapper;
import org.jeecg.common.modules.xetdoctor.service.IXetDoctorService;
import org.jeecg.common.modules.xetuser.entity.XetUser;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: xet_doctor
 * @Author: jeecg-boot
 * @Date:   2021-01-28
 * @Version: V1.0
 */
@Service
public class XetDoctorServiceImpl extends ServiceImpl<XetDoctorMapper, XetDoctor> implements IXetDoctorService {
    @Override
    public List<XetDoctor> getDoctorsByPageId(List<String> pageIdList){
        LambdaQueryWrapper<XetDoctor> query = Wrappers.lambdaQuery();
        query.in(XetDoctor::getPageid,pageIdList);
        query.orderByAsc(XetDoctor::getSort);
        return list(query);
    }

    @Override
    // 所有医生升序排序
    public List<XetDoctor> getDoctorsAll(){
        LambdaQueryWrapper<XetDoctor> query = Wrappers.lambdaQuery();
        query.orderByAsc(XetDoctor::getSort);
        return list(query);
    }

}
